package net.jjjshop.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 订单支付类型枚举
 */
@Getter
@AllArgsConstructor
public enum OrderPayAuthStatusEnum {
    //订单信审状态(10待审核 20审核通过 30审核不通过 40待定)
    NORMAL("待审核", 10),
    PASS_THE_AUDIT("已取消", 20),
    FAIL_THE_AUDIT("审核不通过", 30),
    UNDETERMINED("待定", 40);
    private String name;
    private Integer value;

    //查找name
    public static String getName(Integer value) {
        String name = null;
        OrderPayAuthStatusEnum[] enums = values();    //获取所有枚举集合
        for (OrderPayAuthStatusEnum item : enums) {
            if (item.getValue().intValue() == value.intValue()) {
                name = item.getName();
                break;
            }
        }
        return name;
    }

}
